package Day05;

public class Master {
    public void feed(Pet p){
        if(p instanceof Dog){
            Dog d1 = (Dog)p;
            d1.eat();
        }else if(p instanceof  Cat){
            Cat c1 = (Cat)p;
            c1.eat();
        }else if(p instanceof Rabbit){
            Rabbit r1 = (Rabbit)p;
            r1.eat();
        }
    }
}
